package com.example.function.integration.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

/**
 * @Description：公共bean配置类
 * @Author： fengcheng
 * @Date： 2024/10/9 13:58
 */
@Configuration
public class CommonBeanConfig {

    @Resource(name = "excelFileExportExecutor")
    private ThreadPoolTaskExecutor excelFileExportExecutor;

    @PostConstruct
    public ThreadPoolTaskExecutor getThreadPollObj() {
        // 这里可以使用myStaticBean，它已经被Spring容器正确注入
        System.out.println(excelFileExportExecutor);
        return excelFileExportExecutor;
    }
}
